home *** CD-ROM | disk | FTP | other *** search
- /* Trivial example using TIMER macros
- * Copyright Frank D. Greco, 1987
- * Page 50, Volume 6.1 Programmer's Journal
- */
- #include <stdio.h>
- #include <process.h>
- #include <dos.h>
- #include "timer.h"
-
- main(argc,argv)
- char **argv;
- {
- char *bp; /* Ptr to command to be spawned */
- unsigned long gettime(); /* Gets clock ticks from MS-DOS */
- int value; /* Arbitrary variable */
- int i; /* Arbitrary variable */
-
- bp = argv[1];
-
- TIME(spawnvp(P_WAIT, bp, ++argv), bp);
- TIME( value = 1 + 3 * 8, "value assign.");
-
- START();
- for (i = 15; i--; )
- fputs("hello",stdout),fputs(" world", stdout),fputs(" again\n",stdout);
- STOP();
- PRINT_TIME("puts()");
-
- TIME(
- { int i;
- for ( i = 0; i < 300; i++)
- putchar('X');
- }, "for loop"
- );
-
- exit(0); /* Good Housekeeping */
- }